using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
	[Table("bgm_project_person"), DataContract]
    public class ProjectPerson
    {

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "BgmProjectPerId", ResourceType = typeof(Resources.ProjectPersonResource))]
        [Column("bgm_project_per_seq", TypeName="int")]
        public int ProjectPerId { get; set; }

        [ForeignKey("Project")]
		[DataMember, Display(Name = "BgmProjectId", ResourceType = typeof(Resources.ProjectPersonResource))]
		[Column("bgm_project_seq", TypeName="ntext")]
        public string ProjectId { get; set; }

        [ForeignKey("Employee")]
		[DataMember, Display(Name = "EmpId", ResourceType = typeof(Resources.ProjectPersonResource))]
		[Column("emp_seq", TypeName="int")]
        public Nullable<int> EmpId { get; set; }

		[ForeignKey("Contact")]
		[DataMember, Display(Name = "ContactId", ResourceType = typeof(Resources.ProjectPersonResource))]
		[Column("ContactId", TypeName="int")]
        public Nullable<int> ContactId { get; set; }


        [DataMember]
		public virtual Project Project { get; set; }

        [DataMember]
        public virtual HRM.Employee Employee { get; set; }

        [DataMember]
		public virtual ICM.MasContact Contact { get; set; }


        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}